<!DOCTYPE html>
<html lang="zh-CN">
<head>
    {% load static %}
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}AI-Clinical Note Coach{% endblock %}</title>

    <!-- 引入外部资源 -->
    <!-- <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script> -->
    <!-- <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script> -->
    <script src="{% static 'js/jquery-3.7.1.min.js' %}?v=1212"></script>
    <script src="{% static 'js/bootstrap.bundle.min.js' %}?v=1212"></script>
    <script src="{% static 'js/tailwindcss.js' %}?v=1212"></script>

    <!-- <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"> -->
    <link href="{% static 'css/bootstrap.min.css' %}?v=1212" rel="stylesheet">
    <link href="{% static 'css/font-awesome.min.css' %}?v=1212" rel="stylesheet">
    <!-- <script src="https://cdn.tailwindcss.com"></script> -->
    <!-- <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet"> -->

    
    <!-- 配置Tailwind自定义颜色和字体 -->
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#165DFF',
                        secondary: '#36BFFA',
                        accent: '#0FC6C2',
                        neutral: '#F5F7FA',
                        'neutral-dark': '#E5E6EB',
                        'text-primary': '#1D2129',
                        'text-secondary': '#4E5969',
                    },
                    fontFamily: {
                        sans: ['Inter', 'system-ui', 'sans-serif'],
                    },
                }
            }
        }
    </script>
    
    <!-- 自定义工具类 -->
    <style type="text/tailwindcss">
        @layer utilities {
            .content-auto {
                content-visibility: auto;
            }
            .shadow-soft {
                box-shadow: 0 2px 14px 0 rgba(0, 0, 0, 0.06);
            }
            .bg-gradient-tech {
                background: linear-gradient(135deg, #165DFF 0%, #36BFFA 100%);
            }
        }
    </style>
</head>
<body class="bg-neutral text-text-primary min-h-screen flex flex-col">
    <!-- 顶部导航栏 -->
    <header class="bg-white shadow-soft sticky top-0 z-50">
        <div class="container mx-auto px-4">
            <div class="flex items-center justify-between h-16">
                <!-- 左侧Logo和系统名称 -->
                <div class="flex items-center space-x-3">
                    <div class="bg-gradient-tech text-white p-2 rounded-lg">
                        <i class="fa fa-heartbeat text-xl"></i>
                    </div>
                    <span class="text-xl font-semibold text-primary">AI-Clinical Note Coach</span>
                </div>
                
                <!-- 右侧用户信息和登出 -->
                <div class="flex items-center space-x-6">
                    {% if user.is_authenticated %}
                    <div class="flex items-center space-x-2">
                        <div class="w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center text-primary">
                            <i class="fa fa-user"></i>
                        </div>
                        <span class="hidden md:inline">{{ user.username }}</span>
                    </div>
                    <a href="{% url 'user_logout' %}" class="text-text-secondary hover:text-primary transition-colors">
                        <i class="fa fa-sign-out"></i>
                        <span class="hidden md:inline ml-1">退出</span>
                    </a>
                    {% else %}
                    <p>用户未登录</p>
                    {% endif %}
                </div>
            </div>
        </div>
    </header>

    <!-- 主要内容区 -->
    <main class="flex-grow container mx-auto px-4 py-6">
        {% block content %}{% endblock %}
    </main>

    <!-- 页脚 -->
    <footer class="bg-white border-t border-neutral-dark py-4">
        <div class="container mx-auto px-4 text-center text-text-secondary text-sm">
            <p>© 2025 AI-Clinical Note Coach | All Rights Reserved</p>
        </div>
    </footer>

    <!-- JavaScript -->
    <script>
        // 通用交互脚本
        document.addEventListener('DOMContentLoaded', function() {
            // 处理菜单激活状态
            const currentPath = window.location.pathname;
            const menuItems = document.querySelectorAll('.menu-item');
            
            menuItems.forEach(item => {
                if (item.getAttribute('href') === currentPath) {
                    item.classList.add('bg-primary/10', 'text-primary');
                }
            });
        });
    </script>
    
    {% block extra_js %}{% endblock %}
</body>
</html>
